package org.alvin;

import org.alvin.code.jdbc.ConnectionUtils;
import org.alvin.code.jdbc.ormx.utils.JDBCBaseDaoX;

public class OrmxDemo {

    public static void main(String[] args) throws Exception {
        initConnectionConfig();
        JDBCBaseDaoX jdbcBaseDaoX = new JDBCBaseDaoX();
        TestEntity testEntity = new TestEntity();
        testEntity.setName("1111");
        testEntity.setAge(11);
        testEntity.setRemark("test");
        jdbcBaseDaoX.save(testEntity);

    }



    public static void initConnectionConfig() {
        try {
            String driver = "org.postgresql.Driver";
            String url = "jdbc:postgresql://10.122.129.217:5432/postgres";
            String userName = "a_appconnect";
            String password = "nAH2@Y3S";
            ConnectionUtils.init(driver, url, userName, password,null);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            System.exit(0);
        }
    }
}
